
- if @customer.nil?
  form method = 'get'
    .row
	  .col-md-3
	    .form-group
	      label 车牌号：
	      =link_to"", {:action => 'customer_check', :controller=>'customers', :remote=>true}, {class: 'btn btn-primary btn-xs glyphicon glyphicon-search'}
	      input type='text' class="form-control" name='car_num' value='粤S' pattern="^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$"
	  .col-md-3
	    .form-group
	      label 车型： 
	      br
          = autocomplete_field_tag "car_mo", "", 'autocomplete_car_mo_name', class: 'form-control'
      .col-md-3
        .form-group
	      label 客户姓名：
	      input type='text' class="form-control" name='name' required="required"
	  .col-md-3
	    .form-group
	      label 手机号：
	      input type='text' class="form-control" name='phone' required="required"
	.row
	  .col-md-3
	    .form-group
	      label 车架号：
	      input type='text' class="form-control" name='car_fnum'
	  .col-md-3
	    .form-group
	      label 里程：
	      input type='text' class="form-control" name='last_cf_mileage'
	  .col-md-3
	    .form-group
	      label 油表数：
	      select name="oil_meter" class="form-control"
	        option
	        option 1/2
	        option 1/3
	        option 1/4
	        option 1/5
	        option 2/3
	        option 2/5
	        option 3/4
	        option 3/5
	        option 4/5
	        option 满油
	        option 缺油
	.row
	  .col-md-3
	    .form-group
	      label 重要提示：
          textarea class="form-control" rows="3" name='important_note'
      .col-md-3
        .form-group
          label 备注：
          textarea class="form-control" rows="3" name='note'
	      
	br
    .row
      button type="button" class="btn btn-primary btn-xs glyphicon glyphicon-plus-sign" data-toggle="collapse" data-target="#demo1" style="margin-left:15px;"
      |*展开更多
          
      .collapse id="demo1" 
        
	    .col-md-3
	      .form-group
	        label 下次保养里程：
	        input type='text' class="form-control" name='next_care_mileage'
	    .col-md-3
	      .form-group
	        label 下次保养日期：
	        input type='text' class="form-control" name='next_care_date' data-behaviour='datepicker'
	    .col-md-3
	      .form-group
	        label 交强险到期日：
	        input type='text' class="form-control" name='force_expire' data-behaviour='datepicker'	
	    
	    .col-md-3
	      .form-group
	        label 交强险保险公司：
		    select name='insurer' class="form-control"
		      option
		      - @insurers.each do |i|
		        option value="#{i.id}" = "#{i.name}"
		.col-md-3
		  .form-group
	        label 发动机号：
	        input type='text' class="form-control" name='car_enum'
	    

    br
      button type='submit' class="btn btn-primary btn-lg btn-block" name='save' style="margin-top:50px;" 下一步


- elsif @customer 
  
  form method = 'get'
    .row
	  .col-md-3
	    .form-group
	      label 车牌号：
	      =link_to"", {:action => 'customer_check', :controller=>'customers', :remote=>true}, {class: 'btn btn-primary btn-xs glyphicon glyphicon-search'}
	      input type='text' class="form-control" value='#{@customer.car_num}'  disabled=true
	      input type='text' value='#{@customer.car_num}' name='car_num' hidden=true
	  .col-md-3
        .form-group
	      label 车型：
	      input type='text' class="form-control" value='#{@customer.car_mo}' disabled=true
      .col-md-3
        .form-group
	      label 客户姓名：
	      input type='text' class="form-control" value='#{@customer.name}'  disabled=true
	  .col-md-3
	    .form-group
	      label 手机号：
	      input type='text' class="form-control" value='#{@customer.phone}'  disabled=true 
	  .col-md-3
	    .form-group
	      label 车架号：
	      input type='text' class="form-control" value='#{@customer.car_fnum}' disabled=true
	  .col-md-3
	    .form-group
	      label 里程：
	      input type='text' class="form-control" name='last_cf_mileage' 
	  .col-md-3
	    .form-group
	      label 油表数：	
	      select name="oil_meter" value='#{@customer.oil_meter}' class="form-control"
	        option
	        option 1/2
	        option 1/3
	        option 1/4
	        option 1/5
	        option 2/3
	        option 2/5
	        option 3/4
	        option 3/5
	        option 4/5
	        option 满油
	        option 缺油
	.row
	  .col-md-3
	    .form-group
	      label 重要提示：
          textarea class="form-control" rows="3" name='important_note'
      .col-md-3
        .form-group
          label 备注：
          textarea class="form-control" rows="3" name='note'

	br
    .row
      button type="button" class="btn btn-primary btn-xs glyphicon glyphicon-plus-sign" data-toggle="collapse" data-target="#demo1" style="margin-left:15px;"
      |*展开更多
          
      .collapse id="demo1" 
       
	    .col-md-3
	      .form-group
	        label 下次保养里程：
	        input type='text' class="form-control" name='next_care_mileage' value='#{@customer.next_care_mileage}'
	    .col-md-3
	      .form-group
	        label 下次保养日期：
	        input type='text' class="form-control" name='next_care_date' data-behaviour='datepicker' value='#{@customer.next_care_date}'
	    .col-md-3
	      .form-group
	        label 交强险到期日：
	        input type='text' class="form-control" name='force_expire' data-behaviour='datepicker' value='#{@customer.force_expire}'	disabled=true
	    
	    .col-md-3
	      .form-group
	        label 交强险保险公司：
		    input type='text' class="form-control" name='insurer' value='#{@customer.insurer.name}' disabled=true
		.col-md-3
		  .form-group
	        label 发动机号：
	        input type='text' class="form-control" name='car_enum' value='#{@customer.car_enum}' disabled=true


    br
      button type='submit' class="btn btn-primary btn-lg btn-block" name='save' style="margin-top:50px;" 下一步


javascript:
  $(document).on("focus", "[data-behaviour~='datepicker']", function(e){
    $(this).datepicker({"format": "yyyy-mm-dd", "weekStart": 1, "autoclose": true, "language": "zh-CN", "todayHighlight": true});
  });
